<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>循环渲染</h2>
      <ul>
        <!-- for in 和 for of 是完全等价的 -->
        <li v-for="(item, index) of list">{{ item }}</li>
      </ul>

      <!-- 遍历对象可以有三个参数 value, key, index -->
      <ul>
        <ol v-for="(value, key, index) of object">
          {{ value }} - {{ key }} - {{ index }}
        </ol>
      </ul>
    </div>

    <script src="../Vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          list: [1, 2, 3, 4, 5, 5, 5],
          object: {
            title: "How to do lists in Vue",
            author: "Jane Doe",
            publishedAt: "2016-04-10",
          },
        },
      });
    </script>
  </body>
</html>
